package interview.simulate;

import java.util.Scanner;

/**
 * https://codefun2000.com/p/P1420
 */
public class DeleteNotNeighborChar {

    /**
     1 aeeee
     2 aaeeeeee
     4 aaaaeeeeee
     8 aaaaaaaaeeeeeeeee
     16 aaaabbbbffffff
     开头需要删除的字母数：2^(k-1)
     剩余相同字母数：n-2^(k-1)
     2^(k-1)个字母需要分成x组不同的字母，每组y个字母，y需要小于剩余相同字母数（否则需要被删除的就是“剩余相同字母”了。
     **/
    private static void solve() throws Exception{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt();
        int deleteCount = 1<<(k-1);
        int survivorCount = n-deleteCount;
        if (survivorCount < 1) {
            System.out.println(-1);
            return;
        }
        int groupCount = 1, groupSize = deleteCount;
        while (groupSize > survivorCount) {
            groupCount <<= 1;
            groupSize = deleteCount/groupCount;
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < groupCount; i++) {
            for (int j = 0; j < groupSize; j++) {
                sb.append((char)('a'+(i%26)));
            }
        }
        char survivor = (char)(sb.charAt(sb.length()-1)+1);
        for (int i = 0; i < survivorCount; i++) {
            sb.append(survivor);
        }
        System.out.println(sb.toString());
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        if (n < 2*k || k >= 26) {//这个假设是错误的，例如aaaaeeeee
            System.out.println(-1);
            return;
        }
        StringBuilder sb1 = new StringBuilder();
        for (int i = 0;i <= k;i++) {
            //'a' + i计算出来是一个数字，要转换为字符需要使用(char)强转
            sb1.append((char)('a' + i));
        }
        StringBuilder result = new StringBuilder();
        for (int i = 1;i <= n/(k+1);i++) {
            result.append(sb1);
        }
        for (int i = 1; i<= n%(k+1);i++) {
            result.append("a");
        }
        System.out.println(result.toString());
    }
}
